<template>
	<view>
		<u-mask :show="show" @click="show = false">
				<view class="warps">
					<view class="rects" @tap.stop>
						<view :style="{backgroundImage:'url('+$ftpUrl('/removeTtitle.png')+')'}" style="width: 600rpx;height: 284rpx;background-repeat: no-repeat;background-size: cover;text-align: center;color: #fff;">
							<view style="font-size: 50rpx;font-weight: bold;padding: 40rpx;">去除水印</view>
							<view>付费后可永久查看下载</view>
						</view>
						
						<view>
							<view class="u-padding-40 u-text-center">
								<view>您只需要支付<text class="$u-type-error">2.00元 </text></view>
							     <view class="u-margin-top-20">即可去除该全景漫游图的水印</view>
							</view>
						</view>
						
						<view class="u-text-center" style="width: 300rpx;margin:80rpx auto;">
							<u-button :custom-style="{background:'#FF5D39',color:'#fff'}"  @click="remove" shape="circle">支付去水印</u-button>
						</view>
						
						
						 
					</view>
				</view>
		</u-mask>
		
		<u-toast ref="uToast" />
	</view>
</template>

<script>
	import payway from '@/common/wxpay.js';
	export default {
		props:{
			goodId : {
				value: [String,Number],
				default:''
			},
		
		},
		data() {
			return {
				show: false
			}
		},
		methods:{
			remove(){
				this.$u.post('/indent/removeLogo', {
					cases_id: this.goodId
				}).then(res => {
					if (!Array.isArray(res) ) {
						var packages = res.package;
						var {
							noncestr,
							timestamp,
							signtype,
							paysign
						} = res
						payway.wx(timestamp, noncestr, packages, signtype, paysign).then(res => {     
							   this.$refs.uToast.show({
							   	title: '去水印成功',
							   	type: 'success',
							   	callback :()=>{
							   		this.$emit("remove")
							   	}
							   })
						}).catch(err => {
							
						})
					} else {
						this.$refs.uToast.show({
							title: '去水印成功',
							type: 'success',
							callback :()=>{
								this.$emit("remove")
							}
						})
					}
					
				}).catch(err => {
				
				})
			}
		}
	}
</script>

<style scoped>
	.warps {
		display: flex;
		align-items: center;
		justify-content: center;
		height: 100%;
	}

	.rects {
		
		background-color: #fff;
		border-radius: 20rpx;
	}
</style>